package ingsw2.ii.dp.a;

import java.util.List;
import java.util.ArrayList;

public class MyList<T> {
	
	private List<T> list = new ArrayList<T>();
	
	private int length = 0;
	
	public MyList(){
		
	}
	
	public void addElement(T ob){
		this.length++;
		list.add(ob);
	}
	
	public int length(){
		return this.length;
	}
	
	public int last() {
		return this.length-1;
	}
	
	public T getElement(int pos){
		return list.get(pos);
	}
	
	public MyIterator<T> getForwardIterator(){
		return new MyForwardIterator<T>(this);
	}
		
	public MyIterator<T> getBackwardIterator(){
		return new MyBackwardIterator<T>(this);
	}
	
}
